package com.lgh.demo.activity;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.lgh.demo.R;
import com.lgh.demo.databinding.ActivitySubmitBinding;
import com.lgh.demo.util.WMConstantUtil;
import com.lgh.demo.viewModel.VMSubmit;
import com.sankuai.waimai.opensdk.response.model.preview.PreviewOrder;

public class SubmitActivity extends BaseActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivitySubmitBinding submitBinding = DataBindingUtil.setContentView(this, R.layout.activity_submit);
        PreviewOrder data = (PreviewOrder)getIntent().getSerializableExtra(WMConstantUtil.KEY_Preview_Order);
        String poiImg = getIntent().getStringExtra(WMConstantUtil.KEY_POI_IMG);
        VMSubmit vmSubmit = new VMSubmit(this, submitBinding, data, poiImg);
        submitBinding.setVmSubmit(vmSubmit);
        submitBinding.setPreviewOrder(data);
    }

    @Override
    public void onClick(View v) {
        Toast.makeText(this,"提交订单成功",Toast.LENGTH_LONG).show();
        Intent intent = new Intent(this, PayActivity.class);
        startActivity(intent);
    }
}
